package com.stool.nettyupload.pojo;

public class JsonResponse {

    private static final Integer OK = 200, ERROR = 500;

    private Integer status;
    private String msg;
    private Object data;

    public JsonResponse() {
    }

    public JsonResponse(Integer status, String msg, Object data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }
    public JsonResponse(Integer status, String msg) {
        this.status = status;
        this.msg = msg;

    }

    public static JsonResponse ok(Object data) {
        return new JsonResponse(OK, "", data);
    }

    public static JsonResponse error(String msg) {
        return new JsonResponse(ERROR, msg);
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
